home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Misc / NewFile / Source / Proto.h < prev    next >
Text File  |  1992-11-11  |  1KB  |  64 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. /*
  5.     --------------------------------------------------------
  6. A proto is an encapsulation of the data for a file type
  7. A proto has the fields
  8.     string    typename;
  9.     string    pathname;
  10.     string    editor;
  11.     [OPEN_EDITOR | OPEN_WS | DONT_OPEN]    defaultopen;
  12. The methods below basically return or set these fields.
  13.      --------------------------------------------------------
  14. */
  15.  
  16. #import <objc/Object.h>
  17. #import <string.h>
  18. #import <stdio.h>
  19. #import <sys/param.h>
  20.  
  21. // The length of typename, prototype file's (relative) name and editor
  22. #define NAME_LENGTH 256
  23.  
  24. // Strings for the defaults file.
  25. #define EDITOR_STR "editor"
  26. #define WS_STR "workspace"
  27. #define DONT_STR "dont"
  28. #define NULL_EDITOR "/dev/null"
  29. // The possible types for the opening default.
  30. #define OPEN_EDITOR 0
  31. #define OPEN_WS 1
  32. #define DONT_OPEN 2
  33.  
  34. @interface Proto:Object
  35. {
  36.     char    typename[NAME_LENGTH];
  37.     char    pathname[NAME_LENGTH];
  38.     char    editor[NAME_LENGTH];
  39.     int        defaultopen;
  40. }
  41.  
  42.  
  43. + new:(char *)atypename:(char *)apathname:(char *)aneditor:(int)open;
  44.  
  45. // Create a new proto by reading data from file.
  46. + read:(FILE *)fp;
  47.  
  48. - (char *)typename;
  49. - setTypename:(char *)str;
  50.  
  51. - (char *)pathname;
  52. - setPathname:(char *)str;
  53.  
  54. - (char *)editor;
  55. - setEditor:(char *)str;
  56.  
  57. - (int)defaultopen;
  58. - setDefaultopen:(int)def;
  59.  
  60. // The extension of the prototype file. Returns "" if there is no extension.
  61. - (char *)extension;
  62.  
  63. @end
  64.